/**
 * 
 */
package com.effectivsocial.web.controller;


import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import org.omnifaces.util.Faces;
import org.springframework.context.annotation.Scope;

import com.effectivsocial.domain.Application;
import com.effectivsocial.service.api.ApplicationService;



/**
 * @author Dhrubo
 * 
 */
@Named
@Scope("view")
@Slf4j
public class ApplicationsForm implements Serializable{
	private static final long serialVersionUID = 1L;
	
	@Getter @Setter
	private ApplicationLazyModel model;
	
	@Inject
	private ApplicationService applicationService;
	
	@PostConstruct
	public void init(){
		model = new ApplicationLazyModel(applicationService);
	}
	
	public String goTo(Application application) {
		log.info("application - {}", application);
		

		Faces.setFlashAttribute("application", application);
		// Faces.getFlash().setKeepMessages(true);
		return "editapplication";
	}
	
	
}
